import moment from 'moment';
export const searchProps = [
  {
    type: 'select_input_one',
    value: 'channelId',
    name: '渠道来源',
    selectOptions: [],
    placeholder: '请选择',
    style: {
      width: '120px',
    },
  },
    {
    type: 'input',
    value: 'phone',
    name: '手机号搜索',
    style: {
      width: '200px',
    },
    placeholder: '请输入',
  },
  {
    type: 'input',
    value: 'userName',
    name: '用户名称',
    style: {
      width: '200px',
    },
    placeholder: '请输入',
  },
  {
    type: 'select',
    value: 'pushType',
    name: '推送类型',
    selectOptions: [
      { label: '未匹配', value: '0' },
      { label: '认证未推送', value: '1' },
      { label: '进件成功', value: '2' },
      { label: '进件失败', value: '3' },
      { label: '手推进件成功', value: '4' },
    ],
    placeholder: '请选择',
    style: {
      width: '120px',
    },
  },
  {
    type: 'input',
    value: 'productName',
    name: '产品名称',
    style: {
      width: '200px',
    },
    placeholder: '请输入',
  },

  {
    type: 'input',
    value: 'cityName',
    name: '城市',
    style: {
      width: '120px',
    },
    placeholder: '请输入',
  },
  {
    type: 'select',
    value: 'house',
    name: '房屋',
    selectOptions: [
      { label: '有', value: '有' },
      { label: '无', value: '无' },
    ],
    placeholder: '请选择',
    style: {
      width: '120px',
    },
  },
  {
    type: 'select',
    value: 'car',
    name: '车产',
    selectOptions: [
      { label: '有', value: '有' },
      { label: '无', value: '无' },
    ],
    placeholder: '请选择',
    style: {
      width: '120px',
    },
  },
  {
    type: 'select',
    value: 'accumulation',
    name: '公积金',
    selectOptions: [
      { label: '六个月以上', value: '六个月以上' },
      { label: '六个月以下', value: '六个月以下' },
      { label: '无', value: '无' },
    ],
    placeholder: '请选择',
    style: {
      width: '120px',
    },
  },
  {
    type: 'select',
    value: 'sesameSeed',
    name: '芝麻分',
    selectOptions: [
      { label: '700以上', value: '700以上' },
      { label: '650-699以内', value: '650-699以内' },
      { label: '600-649以内', value: '600-649以内' },
      { label: '600以下', value: '600以下' },
    ],
    placeholder: '请选择',
    style: {
      width: '120px',
    },
  },
  {
    type: 'select',
    value: 'overdueSituation',
    name: '逾期',
    selectOptions: [
      { label: '有逾期', value: '有逾期' },
      { label: '无逾期', value: '无逾期' },
    ],
    placeholder: '请选择',
    style: {
      width: '120px',
    },
  },
  {
    type: 'select',
    value: 'profession',
    name: '职业',
    selectOptions: [
      { label: '上班族', value: '上班族' },
      { label: '公务员-事业单位', value: '公务员-事业单位' },
      { label: '私营企业主', value: '私营企业主' },
      { label: '自由职业', value: '自由职业' },
    ],
    placeholder: '请选择',
    style: {
      width: '120px',
    },
  },
 
  {
    type: 'select',
    value: 'socialSecurity',
    name: '社保',
    selectOptions: [
      { label: '有', value: '有' },
      { label: '无', value: '无' },
    ],
    placeholder: '请选择',
    style: {
      width: '120px',
    },
  },
  {
    type: 'date',
    value: 'time2',
    name: '推送时间',
    placeholder: '请选择',
    showTime: true,
    style: {
      width: '320px',
    },
  },
  {
    type: 'date',
    value: 'time',
    name: '注册时间',
    placeholder: '请选择',
    showTime: true,
    style: {
      width: '320px',
    },
  },





  // {
  //   type: 'input',
  //   value: 'institutionName',
  //   name: '机构名称',
  //   style: {
  //     width: '120px',
  //   },
  //   placeholder: '请输入',
  // },

  // {
  //   type: 'date2',
  //   value: 'time1',
  //   name: '提交时间',
  //   placeholder: '请选择',
  //   showTime: true,
  //   style: {
  //     width: '320px',
  //   },
  // },
 
];

const typeMap = {
  0: '未投放',
  1: 'api',
  2: 'crm',
};

const launchMap = {
  0: '未匹配',
  1: '认证未推送',
  2: '进件成功',
  3: '进件失败',
  4: '手推进件成功',
};

const manualMap = {
  0: '不是',
  1: '是',
};

export const columns = [
  // {
  //   title: '序号',
  //   dataIndex: 'index',
  //   width: 70,
  //   customRender: (text, record, index) => `${index + 1}`,
  // },
  {
    dataIndex: 'channelName',
    title: '渠道名称',
    ellipsis: true,
    width: 120,
    customRender: (text) => text || '/',
  },
  {
    dataIndex: 'userRegister',
    title: '注册时间',
    ellipsis: true,
    width: 180,
    customRender: (text) => (text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '/'),
  },
  {
    dataIndex: 'putTime',
    title: '推送时间',
    ellipsis: true,
    width: 180,
    customRender: (text) => (text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '/'),
  },
  {
    dataIndex: 'pushType',
    title: '推送状态',
    ellipsis: true,
    width: 150,
    customRender: (text) => launchMap[text] || '/',
  },
  {
    dataIndex: 'formInfo.name',
    title: '姓名',
    ellipsis: true,
    width: 100,
    customRender: (text) => text || '/',
  },
  {
    dataIndex: 'formInfo.phone',
    title: '手机号',
    ellipsis: true,
    width: 150,
    customRender: (text) => text || '/',
  },
  {
    dataIndex: 'pushProductName',
    title: '投放产品',
    ellipsis: true,
    width: 150,
    customRender: (text) => text || '/',
  },
  {
    dataIndex: 'formInfo.cityName',
    title: '城市',
    ellipsis: true,
    width: 120,
    customRender: (text) => text || '/',
  },
  {
    dataIndex: 'price',
    title: '价格',
    ellipsis: true,
    width: 100,
    customRender: (text) => text || '/',
  },
  {
    dataIndex: 'filterResult',
    title: '过滤失败结果',
    ellipsis: true,
    width: 200,
    customRender: (text) => text || '/',
  },

  {
    dataIndex: 'matchingProduct',
    title: '匹配结果',
    ellipsis: true,
    width: 200,
    customRender: (text) => text || '/',
  },

  {
    dataIndex: 'manualInstitutionResult',
    title: '撞库机构',
    ellipsis: true,
    width: 200,
    scopedSlots: { customRender: 'manualInstitutionResult' },
  },
  {
    dataIndex: 'manualProductResult',
    title: '撞库api',
    ellipsis: true,
    width: 200,
    scopedSlots: { customRender: 'manualProductResult' },
  },
  {
    dataIndex: 'formInfo.loanAmount',
    title: '借款额度',
    ellipsis: true,
    width: 150,
    customRender: (text) => text || '/',
  },
  {
    dataIndex: 'formInfo.house',
    title: '房产',
    ellipsis: true,
    width: 100,
    customRender: (text) => text || '/',
  },
  {
    dataIndex: 'formInfo.car',
    title: '车产',
    ellipsis: true,
    width: 100,
    customRender: (text) => text || '/',
  },
  {
    dataIndex: 'formInfo.accumulation',
    title: '公积金',
    ellipsis: true,
    width: 150,
    customRender: (text) => text || '/',
  },
  {
    dataIndex: 'formInfo.sesameSeed',
    title: '芝麻分',
    ellipsis: true,
    width: 150,
    customRender: (text) => text || '/',
  },
  {
    dataIndex: 'formInfo.overdueSituation',
    title: '逾期情况',
    ellipsis: true,
    width: 100,
    customRender: (text) => text || '/',
  },
  {
    dataIndex: 'formInfo.profession',
    title: '职业',
    ellipsis: true,
    width: 100,
    customRender: (text) => text || '/',
  },

  {
    dataIndex: 'formInfo.socialSecurity',
    title: '社保',
    ellipsis: true,
    width: 100,
    customRender: (text) => text || '/',
  },
  {
    title: '信息',
    ellipsis: true,
    width: 150,
    scopedSlots: { customRender: 'info' },
  },
  {
    title: '操作',
    width: 160,
    align: 'center',
    fixed: 'right',
    dataIndex: 'operation',
    scopedSlots: {
      customRender: 'operation',
    },
  },
];
